package auth

import (
	"context"
	"github.com/go-kit/kit/endpoint"
	"log"
	"time"
)

func LogMiddleware(logger *log.Logger) endpoint.Middleware {
	return func(next endpoint.Endpoint) endpoint.Endpoint {
		return func(ctx context.Context, request interface{}) (response interface{}, err error) {
			logger.Println("开始记录日志,时间", time.Now())
			defer logger.Println("结束记录日志记录,时间", time.Now())
			return next(ctx, request)
		}
	}
}
